]> dgit.raspbian.org Git - gnome-shell.git/commit
rfkill: Always sync state on construction
authorAndre Moreira Magalhaes <andre@endlessm.com>
Fri, 31 Jul 2020 21:11:48 +0000 (18:11 -0300)
committerverdre <jonas@dressler.it>
Sun, 2 Aug 2020 19:57:11 +0000 (19:57 +0000)
commitdd846f1ba2f3e93d5840dd48bef4eb67ba050848
tree62c21301bf9fe3c8e428e3ec47cc5cd52e232417
parentec3653240a3ca66e7189bf6ded79c20d07bd119a
rfkill: Always sync state on construction

This fixes an issue where the indicator can be out of sync until the
RfkillManager (used by it) properties change.

The problem is that multiple instances of the indicator will use
the same RfkillManager instance (getRfkillManager() returns a singleton)
that only guarantees to emit the changed signal in two scenarios:
when the D-Bus proxy connects and when the proxy properties change.

If by the time an indicator is instantiated the RfkillManager's D-Bus
proxy is already connected, that indicator would only sync its state
when the RfkillManager properties change.

Let's fix that by always syncing the state on construction - in the worst
case scenario the RfkillManager's D-Bus proxy won't have connected yet
and the indicator state will be temporarily out of sync but once it gets
connected the indicator will sync again with the correct state.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/1386
js/ui/status/rfkill.js